<template>
    <div>
        <div style="text-align: left;">
            手术记录
        </div>
        <br><br>
        <el-table :data="operationList" style="width: 100%" border stripe>
            <el-table-column prop="opid" label="编号" width="180"> </el-table-column>
            <el-table-column prop="pname" label="姓名" width="180"> </el-table-column>
            <el-table-column prop="kname" label="科室"> </el-table-column>
            <el-table-column prop="opname" label="手术名称"> </el-table-column>
            <el-table-column prop="dname" label="主刀医生"> </el-table-column>
            <el-table-column prop="opdate" label="手术时间"> </el-table-column>
        </el-table>
        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
            :current-page="pageInfo.pageNum" :page-sizes="[5, 10, 15, 20]" :page-size="pageInfo.pageSize"
            layout="total, sizes, prev, pager, next, jumper" :total="pageInfo.total">
        </el-pagination>
    </div>
</template>

<script>
//导出
export default {
    data() {
        return {
             //获得所有的手术记录信息
             operationList: [],
             //分页
            pageInfo: {
                pageNum: 1,
                pageSize: 5
            },
        };
    },
    methods: {
        handleSizeChange(val) {
            this.pageInfo.pageSize = val;
            this.list();
        },
        handleCurrentChange(val) {
            this.pageInfo.pageNum = val;
            this.list();
        },
        list() {
            this.$axios.get("operation/getAll?pageNum=" + this.pageInfo.pageNum + "&pageSize=" + this.pageInfo.pageSize)
                .then((result) => {
                    let vo = result.data;
                    if (vo.code == 200) {
                        this.operationList=vo.data.list;
                        this.pageInfo = vo.data;
                    }
                }).catch((err) => {
                    console.log(err);
                });
            
                this.$axios.get("patient/getOne")
                .then((result) => {
                    let vo = result.data;
                    if (vo.code == 200) {
                        
                    }
                }).catch((err) => {
                    console.log(err);
                });
        }
    },
    mounted() {
        this.list();
    },
};
</script>
<style></style>